package view.panel.friend
{
	import flash.events.MouseEvent;
	import flash.text.TextField;
	
	import utils.DisplayTool;
	import utils.TextTool;
	
	import view.components.list.ITileListItem;
	import view.panel.mail.MailItem;
	
	
	public class ListFriendItem extends MailItem implements ITileListItem
	{
		private var roomText:TextField;
		private var isShowSign:Boolean;
		
		public function ListFriendItem(isShowSign:Boolean = true)
		{
			this.isShowSign = isShowSign;
			initRoomText();	
		}
		
		private function initRoomText():void
		{
			nameText.y = 2;
			nameText.x = 55;
			roomText = TextTool.getTextFieldXY(nameText.x,nameText.y + nameText.height + 4,nameText.width,nameText.height,12,0xFF7000,"");
			addChild(roomText);
		}
		
		override public function update(data:Object):void
		{
			super.update(data);
			roomText.text = data.room;	
			if (isShowSign == false)
			{
				DisplayTool.removeChild(selectSign.parent,selectSign);
			}
				
		}
		
		override public function destroy():void
		{
			super.destroy();
			roomText = null;
		}
		
		override public function getInstance():ITileListItem
		{
			return new ListFriendItem(isShowSign);
		}
		
		
	}
}